
Partial Class SAD_SQSchemaE
    Inherits System.Web.UI.Page

    Private Const Q As String = Chr(34)

    Private moDatabase As SQLAutoDocLib.Database = Nothing

    Private msDBName As String
    Private msDBID As String
    Private msSID As String

    Private msStartDate As String
    Private msEndDate As String

    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        If IsPostBack = False Then
            msDBID = Request.QueryString("D")
            hidDBID.Value = msDBID

            moDatabase = New SQLAutoDocLib.Database(msDBID)
            moDatabase.Load()

            msDBName = moDatabase.Name
            divDBName.InnerText = msDBName

            msSID = moDatabase.ServerID
            hidSID.Value = msSID

            msStartDate = Request.QueryString("SD")
            If Not IsDate(msStartDate) Then msStartDate = DateAdd(DateInterval.Day, -7, Now).ToShortDateString

            msEndDate = Request.QueryString("ED")
            If Not IsDate(msEndDate) Then msEndDate = DateAdd(DateInterval.Day, 1, Now).ToShortDateString

            txtStartDate.Value = msStartDate
            txtEndDate.Value = msEndDate
        Else
            msDBID = hidDBID.Value
            msSID = hidSID.Value

            msStartDate = txtStartDate.Value
            msEndDate = txtEndDate.Value
        End If

        'APrint.HRef = "SQSchemaE.aspx?D=" & msDBID & "&SD=" & msStartDate & "&ED=" & msEndDate
    End Sub

    Protected Function FormLabel() As String
        Dim sValue As String = ""

        sValue = "Schema Version History"

        Return sValue
    End Function

    Protected Function ScanMode() As String
        Return "Size"
    End Function

    Protected Function EditMode() As String
        Return "Size"
    End Function

    Protected Function ServerID() As String
        Return msSID
    End Function

    Protected Sub ShowChanges()
        Dim oStatusReport As New SQLAutoDocLib.RPT_Status
        HttpContext.Current.Response.Write(oStatusReport.SchemaChanges( _
                                                                msSID, _
                                                                msDBID, _
                                                                Session("BASEDIR"), _
                                                                txtStartDate.Value, _
                                                                txtEndDate.Value))
    End Sub
End Class
